/**
  * Created by wyc on 6/11/2017.
  */
package ninenineqs

object p06 {
  def isPalindrome_v1[T](input:List[T]):Boolean = {
    input == input.reverse
  }
  def isPalindrome_v2[T](input:List[T]):Boolean = {
    input match {
      case Nil => true
      case _ :: Nil => true
      case list => list.head == list.last && isPalindrome_v2(list.init.tail)
    }
  }
}
